package cn.yuemouren.security.core.validate.code;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * @Author: Timi
 * @Description: 验证码操作接口
 * @Date: 2020/7/2 21:07
 * @Version: v1.0
 */
public interface ValidateCodeRepository {
    /**
     * 保存验证码
     * @param request
     * @param code
     * @param type
     */
    void save(ServletWebRequest request,ValidateCode code,ValidateCodeType type);

    /**
     * 获取验证码
     * @param request
     * @param type
     * @return
     */
    ValidateCode get(ServletWebRequest request,ValidateCodeType type);

    /**
     * 删除验证码
     * @param request
     * @param type
     */
    void remove(ServletWebRequest request,ValidateCodeType type);
}
